home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Attributes / Justification.h < prev    next >
Text File  |  1997-06-28  |  814b  |  38 lines

  1. // Justification.h
  2.  
  3. #ifndef Justification_h
  4. #define Justification_h
  5.  
  6. #ifndef Integers_h
  7. #include "Integers.h"
  8. #endif
  9.  
  10. class Rectangle;
  11.  
  12. class Justification
  13.   {
  14.     private:
  15.         uint32 denominator;
  16.         uint32 leadingPart;
  17.         uint32 stretchingPart;
  18.     
  19.     public:
  20.         Justification( uint32 denominator,
  21.                             uint32 leading,
  22.                             uint32 trailing );
  23.         
  24.         uint32 LeadingPortion( uint32 total, uint32 used ) const;
  25.         uint32 TrailingPortion( uint32 total, uint32 used ) const;
  26.         uint32 StretchPortion( uint32 total, uint32 used ) const;
  27.         
  28.         void InsetWidth( Rectangle&, uint32 newWidth ) const;
  29.         void InsetHeight( Rectangle&, uint32 newHeight ) const;
  30.         
  31.         static const Justification& Leading();
  32.         static const Justification& Trailing();
  33.         static const Justification& Center();
  34.         static const Justification& Full();
  35.   };
  36.  
  37. #endif
  38.